package constant;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description:
 * @Author: xiaoma
 * @Date: 2021/8/24 16:35
 */

public class RabbitMqConstatnt {

    //设置死信交换机key
    public static final String x_dead_letter_exchange = "x-dead-letter-exchange";
    //设置死信路由键key
    public static final String x_dead_letter_routing_key = "x-dead-letter-routing-key";
    //设置消息过期时间key
    public static final String x_message_ttl = "x-message-ttl";
    //1分钟
    public static final Integer ttl_1minute = 60000;
    //2分钟
    public static final Integer ttl_2minute = 120000;

    @AllArgsConstructor
    @Getter
    public  enum  RabbitMqExchange{
        stock_event_exchange("stock-event-exchange","库存交换机"),
        order_event_exchange("order-event-exchange","订单交换机"),

        ;
        private String name;
        private String description;
    }
    @AllArgsConstructor
    @Getter
    public  enum  RabbitMqQueue{
        stock_delay_queue("stock.delay.queue","库存延迟队列"),
        stock_release_stock_queue("stock.release.stock.queue","库存解锁队列"),
        order_delay_queue("order.delay.queue","订单延迟队列"),
        order_release_order_queue("order.release.order.queue","订单关单队列"),
        order_seckill_order_queue("order.seckill.order.queue","商品秒杀队列"),

        ;
        private String name;
        private String description;
    }
    @AllArgsConstructor
    @Getter
    public  enum  RabbitMqRoutingKey{
        stock_release_routing_key("stock.release.#","库存延迟路由键"),
        stock_locked_routing_key("stock.locked","库存解锁路由键"),
        order_release_routing_key("order.release.order","订单延迟路由键"),
        order_create_routing_key("order.create.order","订单关单路由键"),
        order_seckill_routing_key("order.seckill.order","商品秒杀路由键"),

        ;
        private String name;
        private String description;
    }
}
